/**
 * 评论：列表组件
 */
import React from 'react';

const List = (props) => {
  console.log(props);
  const { list } = props;
  return (
    <ul className="list">
      {
        list.length ? list.map((item) => {
          return (
            <li key={item.id}>
              <p className="pline">{item.name}</p>
              <p>{item.content}</p>
            </li>
          )
        }) : <li className="nodata"><p>暂无评论！</p></li>
      }
    </ul>
  )
}

export default List